<template>
	<view>
		<view class="zixbox" v-for="(item,index) in dataArr" :key="index" @click="tiao(item.id)">
			<view class="aaa" style="float: left;"></view>
			<view class="" style="display: flex; flex-wrap: wrap;">
				<text>{{item.title}}</text>
				<text class="" style="margin-top: 10px; font-size: 12px;">发表时间:{{item.add_time}}&nbsp;&nbsp;&nbsp;浏览:{{item.click}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataArr:[]
			}
		},
		methods: {
			init(){
				uni.request({
					url:"http://localhost:8082/api/getnewslist",
					method:"GET",
					success: (data) => {
						console.log(data)
						this.dataArr=data.data.message
					}
				})
			},
			tiao(id){
				uni.navigateTo({
					url:`./ziXunXiangXi?id=${id}`
				})
			}
		},
		onLoad(){
			this.init()
		}
	}
</script>

<style>
	.zixbox{
		width: 100%;
		height: 70px;
		border-bottom: 2px solid red;
		/* display: flex; */
	}
	.aaa{
		width: 100px;
		height: 100%;
	}
</style>
